Trait isotope::value::Value [−][src]
pub trait Value: Sized + Clone + Debug {}Show methods
fn ty(&self) -> &ValId; fn into_enum(self) -> ValueEnum; fn code(&self) -> u64; fn is_ty(&self) -> bool { ... } fn is_groupoid(&self) -> bool { ... } fn is_kind(&self) -> bool { ... } fn is_instant(&self) -> bool { ... } fn elem_linearity(&self) -> Result<Linearity, Error> { ... } fn elem_constraints(&self) -> Result<&Constraints, Error> { ... } fn is_lifetime(&self) -> bool { ... } fn ty_linearity(&self) -> Linearity { ... } fn linearity(&self) -> Linearity { ... } fn is_nonlinear(&self) -> bool { ... } fn is_const(&self) -> bool { ... } fn into_valid(self) -> ValId { ... } fn fv(&self) -> &SymbolSet { ... } fn def_fv(&self) -> &SymbolSet { ... } fn local_constraints(&self) -> &Constraints { ... } fn instant_constraint(&self) -> Result<&Constraint, Error> { ... } fn is_normal(&self) -> bool { ... } fn normalized(&self) -> Option<&ValId> { ... } fn contains(&self, value: &ValId) -> Result<Match, Error> { ... } fn subtype(&self, other: &ValId, variance: Variance) -> Result<Match, Error> { ... } fn apply_in_ctx(
&self,
arg: &ValId,
ctx: &mut EvalCtx
) -> Result<ValId, Error> { ... } fn try_apply_in_ctx(
&self,
_arg: &ValId,
_ctx: &mut EvalCtx
) -> Result<Application, Error> { ... } fn eval_in_ctx(&self, ctx: &mut EvalCtx) -> Option<ValId> { ... } fn apply(&self, arg: &ValId) -> Result<ValId, Error> { ... } fn apply_norm(&self, arg: &ValId) -> Result<ValId, Error> { ... } fn try_apply(&self, arg: &ValId) -> Result<Application, Error> { ... } fn try_apply_norm(&self, arg: &ValId) -> Result<Application, Error> { ... } fn apply_ty_in_ctx(
&self,
_arg: &ValId,
_ctx: &mut EvalCtx
) -> Result<Abstract, Error> { ... } fn apply_ty(&self, arg: &ValId) -> Result<Abstract, Error> { ... } fn normal_code(&self) -> u64 { ... }
Expand description
The trait implemented by all isotope
values
Required methods
Provided methods
fn is_groupoid(&self) -> bool
[src]
fn is_groupoid(&self) -> bool
[src]Whether this type, as a category, is a groupoid. Returns false if this value is not a type
fn is_instant(&self) -> bool
[src]
fn is_instant(&self) -> bool
[src]Get whether this value is an instant
fn elem_linearity(&self) -> Result<Linearity, Error>
[src]
fn elem_linearity(&self) -> Result<Linearity, Error>
[src]If this value is a type, the linearity of its elements; otherwise, return an error
fn elem_constraints(&self) -> Result<&Constraints, Error>
[src]
fn elem_constraints(&self) -> Result<&Constraints, Error>
[src]If this value is a type, the minimal constraint of all it’s elements; otherwise, return an error
fn is_lifetime(&self) -> bool
[src]
fn is_lifetime(&self) -> bool
[src]Get whether this value is a lifetime
fn ty_linearity(&self) -> Linearity
[src]
fn ty_linearity(&self) -> Linearity
[src]Get the maximal linearity of this value’s type
The linearity of this value. Always strictly weaker than it’s type’s linearity.
fn is_nonlinear(&self) -> bool
[src]
fn is_nonlinear(&self) -> bool
[src]Get whether this value is nonlinear
Get whether this value is a constant, and hence should not be included in dependency lists
fn into_valid(self) -> ValId
[src]
fn into_valid(self) -> ValId
[src]Convert this value into a ValId
fn local_constraints(&self) -> &Constraints
[src]
fn local_constraints(&self) -> &Constraints
[src]Get the local constraint set of this value
fn instant_constraint(&self) -> Result<&Constraint, Error>
[src]
fn instant_constraint(&self) -> Result<&Constraint, Error>
[src]If this value is an instant, get it’s constraint set, otherwise, return an error
fn normalized(&self) -> Option<&ValId>
[src]
fn normalized(&self) -> Option<&ValId>
[src]Get the normal form of this value, or None
if it is already normalized
Whether this value, as a type, contains the other value under a given set of constraints, and if so, which constraints.
Check if the left type matches the right type given the given variance
Return an error if not, or if either the left or right are not types
Attempt to apply this value to a given argument vector, yielding a result
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
fn try_apply_in_ctx(
&self,
_arg: &ValId,
_ctx: &mut EvalCtx
) -> Result<Application, Error>
[src]
fn try_apply_in_ctx(
&self,
_arg: &ValId,
_ctx: &mut EvalCtx
) -> Result<Application, Error>
[src]Attempt to apply this value to a given argument vector in a given context, yielding a result.
Returns None
if the result is just the value itself.
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
fn eval_in_ctx(&self, ctx: &mut EvalCtx) -> Option<ValId>
[src]
fn eval_in_ctx(&self, ctx: &mut EvalCtx) -> Option<ValId>
[src]Evaluate this value in a given context
Return None
if no changes were made
Attempt to apply this value to a given value, yielding a result
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
Attempt to apply this value to a given value, yielding a normalized result
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
Attempt to apply this value to a given value, yielding a result or a result type (for an abstract application)
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
fn try_apply_norm(&self, arg: &ValId) -> Result<Application, Error>
[src]
fn try_apply_norm(&self, arg: &ValId) -> Result<Application, Error>
[src]Attempt to apply this value to a given value, yielding a normalized result or a result type (for an abstract application)
Returns an error if:
- This value is not a function
- The types don’t match under the desired variance
Attempt to apply this function type to a given value, yielding a result type and a constraint-set
Returns an error if:
- This value is not a function type
- The types don’t match under the desired variance
Attempt to apply this function type to a given value, yielding a result type and a constraint-set
Returns an error if:
- This value is not a function type
- The types don’t match under the desired variance
fn normal_code(&self) -> u64
[src]
fn normal_code(&self) -> u64
[src]Get the normal hash-code of a value.
This allows for rapid normal equality testing, with a small false positive probability. There are no false negatives.